# _*_ coding utf-8 _*_
# FILENAME：inventory.py
# DESCRIPTION: 零件库存 Model
# AUTH: jarvis zhang
# DATE: 2022/6/2 10:00 下午

from sqlalchemy import Column, String, Integer, DATETIME
from models.baseModel import BaseModel


## 零件库存主表
class InventoryModel(BaseModel):
    # 表的名字:
    __tablename__ = 'inventory'
    # 表的结构:
    version_name = Column(String(255), index=True, comment='版本名称')
    factory_id = Column(Integer, comment='工厂ID')
    # 添加索引和表注释
    __table_args__ = ({'comment': '零件库存主表'})

## 零件库存主表详情表
class InventoryDetailsModel(BaseModel):
    # 表的名字:
    __tablename__ = 'inventory_details'
    # 表的结构:
    inventory_id = Column(Integer, index=True, comment='库存主表ID')
    parts_code = Column(String(32), comment='零件件号')
    parts_name = Column(String(64), comment='零件名称')
    parts_inventory = Column(Integer, comment='零件库存数')
    factory_name = Column(String(64), comment='工厂')
    # 添加表注释
    __table_args__ = ({'comment': '零件库存详情表'})